package com.ruoyi.active.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.active.mapper.MembershipActiveMapper;
import com.ruoyi.active.domain.MembershipActive;
import com.ruoyi.active.service.IMembershipActiveService;

/**
 * 入团积极分子Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-13
 */
@Service
public class MembershipActiveServiceImpl implements IMembershipActiveService 
{
    @Autowired
    private MembershipActiveMapper membershipActiveMapper;

    /**
     * 查询入团积极分子
     * 
     * @param maId 入团积极分子主键
     * @return 入团积极分子
     */
    @Override
    public MembershipActive selectMembershipActiveByMaId(Long maId)
    {
        return membershipActiveMapper.selectMembershipActiveByMaId(maId);
    }

    /**
     * 查询入团积极分子列表
     * 
     * @param membershipActive 入团积极分子
     * @return 入团积极分子
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "d")
    public List<MembershipActive> selectMembershipActiveList(MembershipActive membershipActive)
    {
        return membershipActiveMapper.selectMembershipActiveList(membershipActive);
    }

    /**
     * 新增入团积极分子
     * 
     * @param membershipActive 入团积极分子
     * @return 结果
     */
    @Override
    public int insertMembershipActive(MembershipActive membershipActive)
    {
        return membershipActiveMapper.insertMembershipActive(membershipActive);
    }

    /**
     * 修改入团积极分子
     * 
     * @param membershipActive 入团积极分子
     * @return 结果
     */
    @Override
    public int updateMembershipActive(MembershipActive membershipActive)
    {
        membershipActive.setUpdateTime(DateUtils.getNowDate());
        return membershipActiveMapper.updateMembershipActive(membershipActive);
    }

    /**
     * 批量删除入团积极分子
     * 
     * @param maIds 需要删除的入团积极分子主键
     * @return 结果
     */
    @Override
    public int deleteMembershipActiveByMaIds(Long[] maIds)
    {
        return membershipActiveMapper.deleteMembershipActiveByMaIds(maIds);
    }

    /**
     * 删除入团积极分子信息
     * 
     * @param maId 入团积极分子主键
     * @return 结果
     */
    @Override
    public int deleteMembershipActiveByMaId(Long maId)
    {
        return membershipActiveMapper.deleteMembershipActiveByMaId(maId);
    }
}
